<template>
<div class="article-detail-page" style="width: 100vw; height: 100vh;">
  <van-nav-bar  :title="$t('h.ARTICLE_DETAIL_TITLE')" left-arrow @click-left="$router.go(-1)" />
  <div class="article-detail-content">
    <div class="title">{{articles?.title}}</div>
    <div class="create-time">{{articles?.createtime}}</div>
    <div class="content" v-html="articles?.content"></div>
  </div>
</div>
</template>
<script>
import {getArticleDetail} from '@/api/apiFox';
import {Toast} from 'vant';

export default {
  name: 'articleDetail',
  data() {
    return {
      articles: {}
    };
  },
  mounted() {
    Toast.loading({forbidClick: true});
    getArticleDetail(this.$route.params.id).then(res => {
      this.articles = res.data;
      Toast.clear()
    })
  }
};
</script>
<style scoped lang="scss">
.article-detail-page{
  box-sizing: border-box;
  .article-detail-content {
    padding: 20px 20px 20px 20px;
    height:calc(100vh - 50px);
    overflow: hidden;
  }
  .create-time{
    font-size: .4rem;
    color: #999;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
  }
  .content{
    height:calc(100% - 61px - 28px);
    padding-top: 20px;
    box-sizing: border-box;
    padding-bottom: 500px;
    overflow: hidden;
    overflow-y: auto;
  }
}
</style>
